package patterns;

public class ObserverDriver {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

//		Observer[] o = new ObserverImpl[4];
	
		Observer[] o = {new ObserverImpl(),new ObserverImpl(),new ObserverImpl(),new ObserverImpl()};
		Subject s = new SubjectImpl();
		
//		o[0] = new ObserverImpl();
//		o[1] = new ObserverImpl();
//		o[2] = new ObserverImpl();
//		o[3] = new ObserverImpl();
//		
		s.addObserver(o[0]);
		s.addObserver(o[1]);
		s.addObserver(o[2]);
		s.addObserver(o[3]);
		
		Subject s2 = new SubjectImplToo();
		
		s2.addObserver(o[1]);
		s2.addObserver(o[3]);
		
		s2.setState("SUB 2 STATTE");
		
		s.setState("New State");
	}

}
